let nums = [1, 1, 1, 2, 2, 3]
var removeDuplicates = function (nums) {
    if (nums.length === 0) {
        return 0
    }
    let left = 2
    for (let right = 2; right < nums.length; right++) {
        if (nums[left - 2] !== nums[right]) {
            nums[left] = nums[right]
            left++
        }
    }
    return left
};
console.log(removeDuplicates(nums));
